package com.ybkj.chat.module.main.activity;

import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.ybkj.chat.R;
import com.ybkj.chat.base.BaseMvpActivity;
import com.ybkj.chat.manager.ActivityManager;
import com.ybkj.chat.module.dynamic.activity.NearByPeopleDetailsActivity;
import com.ybkj.chat.ui.adapter.NearByAdapter;
import com.ybkj.chat.ui.view.recyclerview.DividerItemDecoration;
import com.ybkj.chat.ui.view.recyclerview.XRecyclerView;
import com.ybkj.chat.ui.view.refreshlayout.XRefreshLayout;
import com.ybkj.chat.utils.ResourcesUtil;

import butterknife.BindView;

/**
 * author : ywh
 * date : 2019/2/19 16:43
 * description :附近的人
 */
public class PeopleNearbyActivity extends BaseMvpActivity {

    //附近的人列表
    @BindView(R.id.nearby_recycle)
    XRecyclerView nearbyRecycle;
    @BindView(R.id.refresh_layout)
    XRefreshLayout refreshLayout;

    private NearByAdapter nearByAdapter;

    @Override
    protected void injectPresenter() {

    }

    @Override
    protected void initTitle() {
        setTitleText(ResourcesUtil.getString(R.string.nearby_people));
        setRightText(ResourcesUtil.getString(R.string.screen));
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_people_nearby;
    }

    @Override
    protected void initView() {
        nearByAdapter = new NearByAdapter(mContext);
        nearbyRecycle.addItemDecoration(new DividerItemDecoration(mContext, DividerItemDecoration.VERTICAL_LIST, 1,
                ResourcesUtil.getColor(R.color.activity_background)));
        nearByAdapter.addData("1");
        nearByAdapter.addData("1");
        nearByAdapter.addData("1");
        nearByAdapter.addData("1");
        nearByAdapter.addData("1");
        nearByAdapter.addData("1");
        nearByAdapter.addData("1");
        nearByAdapter.bindToRecyclerView(nearbyRecycle);
        nearByAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
            @Override
            public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
                ActivityManager.gotoActivity(mContext, NearByPeopleDetailsActivity.class);
            }
        });
    }

    @Override
    protected void initData() {

    }

    @Override
    public void onRightTextClick() {
        super.onRightTextClick();
        ActivityManager.gotoActivity(mContext, ScreenActivity.class);
    }

}
